package com.ruoyi.ipms_patent.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.ipms_patent.dto.ContractDto;
import com.ruoyi.ipms_patent.service.ContractService;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*/*
 * Description : TODO  立案采集
 * ChangeLog : 1. 创建 (2022/4/21 11:22 [zhouhongcheng]);
*/
@RestController
@RequestMapping("/patent")
@RefreshScope    //开启支持nacos动态配置修改，默认是关闭，要开启
public class ContractController extends BaseController {

    @Resource
    private ContractService contractService;

    /*/*
     * Description : TODO 获取合同列表
     * ChangeLog : 1. 创建 (2022/4/21 11:46 [zhouhongcheng]);
    */
    @GetMapping("/contract")
    public TableDataInfo selectcontractList(ContractDto contractDto) {

        startPage();
        List<ContractDto> list = contractService.selectcontractList(contractDto);
        return getDataTable(list);

    }

    /*/*
     * Description : TODO 立案成功修改合同状态
     * ChangeLog : 1. 创建 (2022/4/21 11:46 [zhouhongcheng]);
     */
    @GetMapping("/contractupdate/{contractNos}")
    public AjaxResult updatecontract(@PathVariable("contractNos") List contractNos) {
        return AjaxResult.success(contractService.updatecontract(contractNos));
    }



}
